From Simple IO to Monad Transformers by J Adrian Zimmer
Author:J Adrian Zimmer
Language: eng
Format: epub
Publisher: J Adrian Zimmer
Here is a program you can compile and execute to test this. In it I have extracted the interior object from pairs getLine getLine, converted it to a string and printed it.
pairs :: Monad m => m t -> m u -> m (t,u)
pairs lst1 lst2 = do
x <- lst1
y <- lst2
return (x,y)
main = pairs getLine getLine >>= (\z -> putStrLn (show z))
This program, of course, silently asks for two lines of input. As a further exercise, you might want to change it so that it requests input with a "Input? " prefix. Then execution would look like
Input? line 1
Input? line 2
("line 1","line 2")
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8522)
Test-Driven Development with Java by Alan Mellor(7390)
Data Augmentation with Python by Duc Haba(7291)
Principles of Data Fabric by Sonia Mezzetta(7037)
Learn Blender Simulations the Right Way by Stephen Pearson(6972)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6797)
RPA Solution Architect's Handbook by Sachin Sahgal(6207)
Hadoop in Practice by Alex Holmes(6030)
The Infinite Retina by Robert Scoble Irena Cronin(5906)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5873)
Big Data Analysis with Python by Ivan Marin(5716)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5402)
Pretrain Vision and Large Language Models in Python by Emily Webber(4677)
Infrastructure as Code for Beginners by Russ McKendrick(4459)
WordPress Plugin Development Cookbook by Yannick Lefebvre(4189)
Functional Programming in JavaScript by Mantyla Dan(4124)
The Age of Surveillance Capitalism by Shoshana Zuboff(4116)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3975)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3953)
